from app.serve.wtrees.base import BaseModel
from sqlalchemy import (
    Column,
    Index,
    Integer,
    String,
)


class UserModel(BaseModel):
    __tablename__ = "wtrees_user"
    __table_args__ = (
        Index("username_del", "username", "delete_time", unique=True),
        Index("email_del", "email", "delete_time", unique=True),
    )

    id = Column(Integer(), primary_key=True)
    username = Column(String(24), nullable=False, comment="用户名，唯一")
    nickname = Column(String(24), comment="用户昵称")
    avatar = Column(String(500), comment="头像url")
    email = Column(String(100), comment="邮箱")


